package cn.lackofcsy.pojo.vo;


import lombok.Data;

@Data
public class Result<T> {
    private Integer code;
    private String msg;
    private T data;

    public Result(Integer code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
    public static <T> Result <T> success(T data){
        Result<T> result = new Result(200, "成功",data);
        return result;
    }    
    public static <T> Result <T> success(){
        Result<T> result = new Result(200, "成功",null);
        return result;
    }

    public static <T> Result <T> success(String msg,T data){
        Result<T> result = new Result(200,msg, data);
        return result;
    }
    public static <T> Result <T> error(Integer code,String msg){
        Result<T> result = new Result(code,msg, null);
        return result;
    }
}
